<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                               |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: xiangminghu@clcw.com.cn                                        |
// +------------------------------------------------------------------------+
//

namespace AuctionBack\Logic;

use AuctionBack\Model\ClcwCarOmenModel;

class ClcwCarOmenLogic extends BaseLogic
{
    protected $autoCheckFields = false;

    protected $clcwCarOmenModel;

    public function _initialize()
    {
        $this->clcwCarOmenModel = new ClcwCarOmenModel();
    }


    /**
     * 获取用户车辆吉凶列表
     *
     * @param int $uid
     */
    public function getCarOmenListByUid($uid = 0)
    {
        if (empty($uid)) {
            return false;
        }
        $list = $this->clcwCarOmenModel->where(['user_id' => $uid])->select();
        if (!empty($list)) {
            $i = 1;
            foreach ($list as $k => $v) {
                $list[$k]['sort'] = $i;
                $list[$k]['create_time'] = date("Y-m-d H:i:s", $v['create_time']);
                $i++;
            }
        }
        return $list;
    }
}